#ifndef __MOOSE_HTTP_H__
#define __MOOSE_HTTP_H__

#include <moose_list.h>

/* Define HTTP method type */
typedef enum moose_http_method_e{
    E_MOOSE_HTTP_METHOD_GET = 0,
    E_MOOSE_HTTP_METHOD_POST,
    E_MOOSE_HTTP_METHOD_HEAD,
    E_MOOSE_HTTP_METHOD_PUT,
    E_MOOSE_HTTP_METHOD_DELETE,
    E_MOOSE_HTTP_METHOD_CONNECT,
    E_MOOSE_HTTP_METHOD_OPTIONS,
    E_MOOSE_HTTP_METHOD_TRACE
}moose_http_method_e;
const char* moose_http_get_method_str(moose_http_method_e method);
/* END Define HTTP method type */

/* Define HTTP URL struct */
typedef struct moose_http_get_data_s {
    char* key;
    char* value;
}moose_http_get_data_s;
typedef struct moose_http_url_s {
    char*   domain;
    char*   resource;

    bool    is_get;
    moose_list get_data;
}moose_http_url_s;
/* END Define HTTP URL struct */

/* Define HTTP Header struct */
typedef struct moose_http_header_s {
    moose_http_method_e method;
    moose_http_url_s    url;
    char*               http_protocol;

    /* attribute */
    /* other */
    moose_list other_data;
}moose_http_header_s;
/* END Define HTTP Header struct */

typedef moose_http_s {
    moose_http_header_s header;

    /* Body aligned with post data */
    char*   body;
    bool    is_post;
    moose_list post_data;
}moose_http_s;

#endif
